#ifndef QXSQLCLASS_H
#define QXSQLCLASS_H

#include <QtCore>
#include <QtGui>
#include <QtSql>

class QxSqlClass : public QObject
{
    Q_OBJECT
public:
    explicit QxSqlClass(QObject *parent = 0);
    QxSqlClass(QString SqlDriver,QObject *parent = 0);
public://Methods
    void m_Connect();
    void m_DisConnect();
    bool m_IsConnected();
    QVariant* m_RunQuery(QString QueryCmd);
    QVariant  m_ExecStoredProcedure(QString cmd);

    void m_SetSqlDriver(QString SqlDriver);
    QString m_GetSqlDriver();
    bool m_TestConnection();
    void m_SetConnectionOptions(QString db_host,QString db_name,QString db_user,QString db_password,int db_port = 3306);
private://Properties
    bool p_Connected;
    QString p_SqlDriver;
    QString p_db_host;
    unsigned int p_db_port;
    QString p_db_user;
    QString p_db_pwd;
    QString p_db_name;
signals:
    void OnSetConnectionOptions();//Emits when m_SetConnectionOptions is called =) && Next Step Is emit OnTestConnection ???
private slots:
    void OnSetSqlDriver();
public slots:
    void OnTestConnection();

};

#endif // QXSQLCLASS_H
